﻿using Microsoft.Xna.Framework.Content.Pipeline;
using System.Xml.Serialization;
using System.IO;


namespace ContentPipelineExtension1
{
    [ContentImporter(".prism", DefaultProcessor = "PrismGenerator")]
    class PrismDefinitionImporter : ContentImporter<PrismDefinition>
    {
        public override PrismDefinition Import(string filename, ContentImporterContext context)
        {
            PrismDefinition def = null;

            XmlSerializer ser = new XmlSerializer(typeof(PrismDefinition));

            using (StreamReader sr = File.OpenText(filename))
            {
                def = ser.Deserialize(sr) as PrismDefinition;
            }

            return def;
        }
    }
}
